package section3_3;

/**
 * Created by Hyman on 2017/6/3.
 *
 * 资源的多副本的并发访问控制
 */
public class Main {

    public static void main(String[] args) {

        // 创建一个打印队列对象
        PrintQueue printQueue = new PrintQueue();

        // 创建10个线程
        Thread thread[] = new Thread[10];
        for (int i = 0; i < 10; i++) {
            thread[i] = new Thread(new Job(printQueue), "Thread " + i);
        }

        // 启动10个线程
        for (int i = 0; i < 10; i++) {
            thread[i].start();
        }

    }
}
